<?php
require_once "../../config.php";
require_once $lib_path."includeFunctions.php";
require_once $lib_path."filter.php";
require_once $lib_path."simplepie/simplepie.inc";
require_once $lib_path."ExpandWord.php";

$digg = new SimplePie('http://digg.com/rss/index.xml');
 
$tuaw = new SimplePie();
$tuaw->set_feed_url('http://feeds.tuaw.com/weblogsinc/tuaw');
$tuaw->set_favicon_handler('handler_image.php');
$tuaw->init();
 
$uneasy = new SimplePie('http://feeds.uneasysilence.com/uneasysilence/blog');
 
$merged = SimplePie::merge_items(array($digg, $tuaw, $uneasy));
 
header('Content-type:text/html; charset=utf-8');
 
//echo "<pre>";print_r($merged);echo "</pre>";exit;
 
//$item = $merged[0];
//echo $item->get_title();


$counter = 0;

foreach($merged as $item){
	echo '<div class="gradient">';
	echo '<h1><a href="'.urldecode($item->get_permalink()).'" target="_blank">'.$item->get_title().'</a></h1>';
	
	/*
	 * $title_strip = strip_punctuation($item->get_title());
	echo "<pre>";print_r($title_strip);echo"</pre>";
	if(!empty($title_strip)){
		$expand_words = $expand->getWords(str_split_utf8($title_strip));
		echo "<pre>";print_r($expand_words);echo"</pre>";
	}
	*/
	echo '<p class="block small gold">'.$item->get_date('j M Y  g:i a').'</p>';
	echo '<p>'.$item->get_content().'</p>';
	echo '<blockquote class="exclamation">';		
		echo '<div id="keyword_pool'.$counter.'" class="keyword_pool">';
			echo '<p id="loading_img'.$counter.'"><img src="styles/images/ui-anim_basic_16x16.gif"/></p>';
			echo '<p id="keyword_pool'.$counter.'_string" style="display:none">'.urlencode($item->get_title()).'</p>';
		echo '</div>';
	echo '</blockquote>';
	echo '</div>';	
	$counter++;
}


?>